﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Text;
using System.Threading.Tasks;


namespace HYBY.WebFrameWork.Security
{
    public static class SecurityExtensions
    {
        public static AuthUser GetAuthUser(this IPrincipal principal)
        {
            if (principal.Identity is AuthUser)
                return (AuthUser)principal.Identity;
            else
              return new AuthUser(-1,string.Empty);
        }
    }
}
